package com.pazl.check.api.provider;

import java.util.ArrayList;
import java.util.List;

import org.hibernate.validator.spi.group.DefaultGroupSequenceProvider;

import com.pazl.check.api.req.dto.Req25Dto;

public class Req25GroupSequenceProvider implements DefaultGroupSequenceProvider<Req25Dto>{

	@Override
	public List<Class<?>> getValidationGroups(Req25Dto bean) {
		List<Class<?>> defaultGroupSequence = new ArrayList<Class<?>>();
		defaultGroupSequence.add(Req25Dto.class);
		if(bean != null){
			String isSponsor = bean.getRenterInfo().getIsSponsor();
			//有担保人
			if("1".equals(isSponsor)){
				defaultGroupSequence.add(Req25Dto.Sponsor.class);
			}
		}
		return defaultGroupSequence;
	}

}
